import Vue from 'vue'
import Cookies from 'js-cookie'
import App from './App.vue'
import router from './router'
import store from './store'
import * as filters from './filters'
import '@/styles/index.scss' // global css
import ElementUI from 'element-ui'

import './icons'
import './permission' // 权限认证
import _ from 'lodash'
import moment from 'moment'

// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
import globalConstants from './config' // 引入
Vue.prototype.CMBASE = globalConstants

import VueUeditorWrap from 'vue-ueditor-wrap'
// 全局注册组件
Vue.component('vue-ueditor-wrap', VueUeditorWrap)

Vue.prototype.moment = moment
Vue.prototype._ = _
Vue.config.productionTip = false
Vue.prototype.isPro = process.env.NODE_ENV === 'production'

Vue.use(ElementUI, {
  // size: Cookies.get('size') || 'medium' // set element-ui default size
  size: Cookies.get('size') || 'mini' // set element-ui default size
  // i18n: (key, value) => i18n.t(key, value)
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
